const path = require("path");
const rootPath = path.resolve(__dirname,"app"),
    src = path.join(rootPath,"component");
const WebpackDevServer = require('webpack-dev-server');
const webpack = require('webpack');

module.exports = {
    // devtool:'source-map',
    entry: [
        path.resolve(__dirname, 'app', 'App.js'),
    ],
    output: {
        path: path.resolve(__dirname, "build"),
        filename: "js/bundle.js",
    },
    resolve:{
        extensions: ["",'.js','.jsx'],
        alias:{
            ANT_DE:path.join(src,"general/ant_plugin.js"),
            fly:path.join(src,"common/fly/index.js"),
            EVE_MAN:path.join(src,"util/EventManager.js"),
        }
    },
    // plugins:[
    //     new webpack.optimize.UglifyJsPlugin({
    //         compress: {
    //             warnings: false
    //         }
    //     }),
    // ],
    module: {
        loaders: [{
            test: /\.js|jsx$/,
            exclude: /node_modules/,
            loader: "babel-loader"
        }, {
            test: /\.css$/,
            exclude: /node_modules/,
            loader: "style!css"
        }, {
            test: /\.scss$/,
            loader: 'style!css!sass!'
        }, {
            test: /\.(png|jpg)$/,
            exclude: /node_modules/,
            loader: 'url-loader'
        }]
    },
};
